<%--
 * action-1.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@taglib prefix="acme" tagdir="/WEB-INF/tags"%>

<display:table pagesize="5" class="displaytag" keepStatus="true"
	name="auctions" requestURI="${requestURI}" id="row">


	<spring:message code="auction.customer" var="customerHeader" />
	<display:column property="customer.name" title="${customerHeader}"
		sortable="false" />
	<spring:message code="auction.painting" var="paintingHeader" />
	<display:column property="painting.title" title="${paintingHeader}"
		sortable="false" />
	<spring:message code="auction.startMoment" var="startMomentHeader" />
	<display:column property="startMoment" title="${startMomentHeader}"
		sortable="false" format="{0,date,dd/MM/yyyy HH:mm}" />
	<spring:message code="auction.finishMoment" var="finishMomentHeader" />
	<display:column property="finishMoment" title="${finishMomentHeader}"
		sortable="false" format="{0,date,dd/MM/yyyy HH:mm}" />
	<spring:message code="auction.startingPrice" var="startingPriceHeader" />
	<display:column property="startingPrice" title="${startingPriceHeader}"
		sortable="false" />
		
	<security:authorize access="hasRole('ADMINISTRATOR')">
		<display:column>
			<a href="bid/administrator/list.do?auctionId=${row.id}"><spring:message
					code="auction.bids.view" /></a>
		</display:column>

	</security:authorize>
	
		<security:authorize access="hasRole('CUSTOMER')">
			
		<display:column>
		<jstl:if test="${isOwner}">
			<a href="bid/customer/list.do?auctionId=${row.id}"><spring:message
					code="auction.bids.view" /></a>
		</jstl:if>
		<jstl:if test="${!isOwner}">
			<a href="auction/customer/edit.do?auctionId=${row.id}"><spring:message
					code="auction.viewAuction" /></a>
		</jstl:if>
		</display:column>
			

	</security:authorize>
</display:table>


<acme:cancel code="auction.goBack" url="${backURI}" />


